/* 基础样式 */
body {
    font-family: Arial, sans-serif;
    padding: 20px;
}

/* 控制面板样式 */
.control-panel {
    display: flex;
    justify-content: space-between;/*两端对齐*/
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.input-group {
    gap: 15px;
    align-items: center;

}

.input-group input {
    width: 30px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.input-group label {
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.action-group {
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}


button {
    padding: 5px 15px;
    cursor: pointer;
}

.time-display {
    color: #666;
    font-size: 0.9em;
}

/* 统计模块 */
.main-content {
    display: flex;
    gap: 20px;
    flex: 1;
}

.map-container {
    flex: 2;
}

.stats-container {
    flex: 1;
    min-width: 650px;
}

.stats-panel {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.stats-scrollable {
    flex: 1;
    overflow-y: auto;
}

#statsTable {
    width: 100%;
    border-collapse: collapse;
}

#statsTable th, #statsTable td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
}

#statsTable th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
}

.stats-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.stats-actions button {
    flex: 1;
    padding: 8px;
}

/* 图片上传 */
/* 新增响应式样式 */
.grid.image-mode {
    max-width: 100%;
    overflow: auto;
}

.grid.image-mode .cell {
    min-width: 8px;
    min-height: 8px;
    border: 0.5px solid rgba(0,0,0,0.05);
}

/* 坐标轴适配 */
.coordinate-system.image-mode .x-axis, 
.coordinate-system.image-mode .y-axis {
    font-size: 0.8em;
}
/* 坐标系统 */
.coordinate-system {
    position: relative;
    display: inline-block;
    margin: 30px 0 0 30px;
}

.grid {
    display: grid;
    gap: 1px;
    background: #333;
    padding: 1px;
}


.cell {
    position: relative; /* 为绝对定位标记提供参照 */
    width: 25px;
    height: 25px;
    background: white;
    transition: background 0.2s;
    cursor: pointer;
}

/* 颜色定义 */
.start { background: #9C27B0; }  /* 紫色 */
.end { background: #9C27B0; }    /* 紫色 */
.wall { background: #212121; }   /* 黑色 */
.visited { background: #c2b7b7; }/* 浅红色 */
.current { background: #4CAF50; }/* 绿色 */
.path { background: #FF0000; }   /* 红色 */

/* 坐标轴样式 */
.y-axis, .x-axis {
    position: absolute;
    background: #f0f0f0;
    font-size: 20px;
    color: #666;
}

.y-axis {
    left: -30px;
    top: 0;
    width: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.x-axis {
    bottom: -30px;
    left: 0;
    width: 100%;
    height: 30px;
    display: flex;
    align-items: flex-start;
}

.y-axis span, .x-axis span {
    width:26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* 新增符号标记样式 */
.constraint-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    color: greenyellow;
    pointer-events: none; /* 防止干扰点击 */
    z-index: 2;
}

/* 在styles.css中添加A2区域样式 */
.a2-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FF5722; /* 橙色 */
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 3px white;
    z-index: 2;
    animation: pulse 1.5s infinite;
}
/*A2区域*/
@keyframes pulse {
    0% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
}



/* 边界障碍连通块样式 */
.border-obstacle {
    position: relative;
    background-color: blue !important; /* 橙色 */
    opacity: 0.7;
}

/* 连通块标记（可选） */
.border-obstacle::after {
    content: attr(data-component);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 0 2px black;
}

.connected-obstacle {
    background-color: #2196F3 !important; /* 蓝色 */
    opacity: 0.8;
    position: relative;
}

.connected-obstacle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.external-connected-obstacle {
    background-color: #2196F3 !important;
    position: relative;
}

.external-connected-obstacle::after {
    /* content: '⇲'; 外部标记符号 */
    position: absolute;
    top: 2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 右键菜单样式 */
.context-menu {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.context-menu li {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
}

.context-menu li:hover {
    background: #f0f0f0;
}



/* 添加连通块荧光轮廓样式 */
.glow-outline {
    position: relative;
    box-shadow: 
        0 0 8px #00ff00,
        0 0 12px #00ff00,
        inset 0 0 4px #00ff00;
    z-index: 1;
    animation: glow-pulse 1.2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}




/* 添加全局最方位点标注样式 */
.global-extreme {
    position: relative;
    z-index: 3;
    animation: extreme-glow 2s ease-in-out infinite;
}

.global-north {
    box-shadow: 0 -4px 12px #00FF00,
                0 -2px 6px #00FF00;
}

.global-south {
    box-shadow: 0 4px 12px #FF0000,
                0 2px 6px #FF0000;
}

.global-east {
    box-shadow: 4px 0 12px #2196F3,
                2px 0 6px #2196F3;
}

.global-west {
    box-shadow: -4px 0 12px #9C27B0,
                -2px 0 6px #9C27B0;
}

@keyframes extreme-glow {
    0% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.8; transform: scale(1); }
}

.global-extreme::after {
    content: attr(data-global-dir);
    position: absolute;
    top: 2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 3px black;
}

